package com.info.zhiduoduo.pay.sdk.zhaoshangbank.model.common.pay;

import com.info.zhiduoduo.pay.formbean.zhaoshangbankpay.ZhaoShangAgentPayFormBean;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class DetailedInfo {

	/** 交易序号 */
	private String trxseq;   //需要客户自行保证批次范围内的序号唯一性，代发代扣系统要求格式为全数字，如’00000001’、’00000002’
	/** 收方户口 */
	private String eacnbr;
	/** 收方户名 */
	private String eacnam;
	/** 合作方流水号 */
	private String cprref;   //暂无用，预留
	/** 明细交易金额 */
	private String rcvamt;
	/** 客户在合作方账号 */
	private String cpract;   //以前代扣将合作方帐号填到注释字段里，现在可以改为填到这个字段；代发可空
	/** 交易摘要 */
	private String trxtxt;



	public static List<DetailedInfo> ofList(ZhaoShangAgentPayFormBean formBean){
		List<DetailedInfo> infoList = new ArrayList<>();
		DetailedInfo detailedInfo = new DetailedInfo()
				.setTrxseq("00000001")
				.setEacnbr(formBean.getAcctno())
				.setEacnam(formBean.getAcctname())
				.setRcvamt(formBean.getAmount().toString());
		infoList.add(detailedInfo);
		return infoList;
	}

}
